﻿using System;
using System.Collections;
using System.Collections.Generic;


namespace Petra.Gis.RenderingServices.PlanarBase 
{

  public class DisplayOrder : IList<LegendNode> //, IEnumerable<LegendNode>, 
  {

    private List<LegendNode> _displayOrder;
    private MapLegend _legend;

    //public delegate void DisplayOrderChange(object source, int originalPosition, int newPosition);
    //public event DisplayOrderChange OnDisplayOrderChange;

    internal DisplayOrder(MapLegend legend, List<LegendNode> list)
    {
      _legend = legend;
      _displayOrder = list;
    }



    public void Add(LegendNode item)
    {
      //_displayOrder.Add(item);
    }



    public void Clear()
    {
      //_displayOrder.Clear();
    }



    public bool Contains(LegendNode item)
    {
      return _displayOrder.Contains(item);
    }



    public bool IsReadOnly 
    {
      get { return true; }
    }


    public bool Remove(LegendNode item)
    {
      //return _displayOrder.Remove(item);
      return false;
    }




    public void RemoveAt(int index)
    { 
      
    }
    
    
    public int Count 
    {
      get { return _displayOrder.Count; }
    }



    public void CopyTo(LegendNode[] array, int arrayIndex)
    { 
      
    }




    public IEnumerator<LegendNode> GetEnumerator()
    {
      return _displayOrder.GetEnumerator();
    }




    IEnumerator IEnumerable.GetEnumerator()
    {
      return GetEnumerator();
    }



    public void MoveNode(int nodeIndex, int newPositionIndex)
    {
      
    }



    public LegendNode this[int index]
    {
      get {return _displayOrder[index];}
      set { }
    }



    public int IndexOf(LegendNode item)
    {
      return _displayOrder.IndexOf(item);
    }



    public void Insert(int index, LegendNode item)
    {
      //_displayOrder.Insert(index, item);
    }


  }
}
